package org.example.syn;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Yyming
 * @version 10.0
 * Created by Yyming on 2021/3/2
 */
public class AotuTest {
    static AtomicInteger atomicInteger = new AtomicInteger(0);
    public static void main(String[] args) {
        new Thread(() -> {
//            while (atomicInteger.get() == 0) {
//                System.out.println("con");
//            }
//            System.out.println("break");
            while (true) {
                System.out.println("aaa" + atomicInteger.addAndGet(1));
            }
        }).start();


        new Thread(() -> {
//            System.out.println("===>");
//            atomicInteger.addAndGet(1);
            while (true) {
                System.out.println("bbb" + atomicInteger.addAndGet(1));
            }
        }).start();

    }
}
